/*
 * Copyright 2010 - 2011, The PLDesktop Development Team
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License as published by the Free Software Foundation; either
 *  version 2.1 of the License, or (at your option) any later version.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 *  Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public
 *  License along with this library; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 *
 */

#ifndef PLJAVA_ATTRIBUTE_STACK_MAP_H
#define PLJAVA_ATTRIBUTE_STACK_MAP_H

#include <PLJavaFile.h>

namespace PLSDK {

/**
 * Class to hald stack map information in the stack map table.
 */
class PLJavaAttributeStackMap {
public:
    /**
     * The frame type of the stack map.
     */
    enum FrameType {
        /**
         * Same frame type.
         */
        Same                        = 0,
        /**
         * Same Locals 1 Stack Item.
         */
        SameLocals1StackItem        = 1,
        /**
         * Same Locals 1 Stack Item Extended.
         */
        SameLocals1StackItemExtended = 2,
        /**
         * Chop frame type.
         */
        Chop                        = 3,
        /**
         * Same Frame Extended frame type.
         */
        SameFrameExtended           = 4,
        /**
         * Append frame type.
         */
        Append                      = 5,
        /**
         * Full frame type.
         */
        FullFrame                   = 6
    };
    /**
     * Constructor.
     */
    PLJavaAttributeStackMap();
    /**
     * Get the frame type that represent the code.
     *
     * @return The frame type.
     */
    inline PLJavaAttributeStackMap::FrameType frameType();
protected:
    PLJavaAttributeStackMap::FrameType m_frameType;
};

PLJavaAttributeStackMap::FrameType PLJavaAttributeStackMap::frameType() {
    return m_frameType;
}

}

#endif
